package datatypes.r2.basic.impl;



import javax.persistence.Embeddable;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import datatypes.r2.basic.CD;
import datatypes.r2.basic.CS;
import datatypes.r2.basic.ST;
import datatypes.r2.basic.UID;
import datatypes.r2.flavors.ED_TEXT;
import datatypes.r2.flavors.ST_NT;
import datatypes.r2.flavors.ST_SIMPLE;
import datatypes.r2.flavors.impl.StringNoTranslations;
import datatypes.r2.flavors.impl.StringSimple;
import datatypes.r2.flavors.impl.TextWithReference;
import datatypes.r2.foundation.BL;
import datatypes.r2.foundation.DSET;
import datatypes.r2.foundation.SET;
import datatypes.r2.foundation.impl.DataValue;
import datatypes.r2.foundation.impl.DiscreteSet;
import datatypes.r2.foundation.impl.Set;

/**
 * A reference to a concept defined in a code system
 * 
 * @author Obama
 * 
 */
@javax.persistence.Entity
public class ConceptDescriptor extends DataValue implements CD {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private long id;
	
	@ManyToOne
	@JoinColumn(name="code_id")
	private StringSimple code;
	private UniqueIdentifierString codeSystem;
	private StringNoTranslations codeSystemName;
	private StringSimple codeSystemVersion;
	private UniqueIdentifierString valueSet;

	private StringSimple valueSetVersion;
	private CharacterString displayName;
	private TextWithReference originalText;
	private Set<CodedSimpleValue> codingRationale;
	private DiscreteSet<ConceptDescriptor> translation;
	private ConceptDescriptor source;

	@Override
	public ST_SIMPLE code() {

		return code;
	}

	@Override
	public UID codeSystem() {

		return codeSystem;
	}

	@Override
	public ST_NT codeSystemName() {

		return codeSystemName;
	}

	@Override
	public ST_SIMPLE codeSystemVersion() {

		return codeSystemVersion;
	}

	@Override
	public UID valueSet() {

		return valueSet;
	}

	@Override
	public ST_SIMPLE valueSetVersion() {

		return valueSetVersion;
	}

	@Override
	public ST displayName() {

		return displayName;
	}

	@Override
	public ED_TEXT originalText() {

		return originalText;
	}

	@Override
	public SET<? extends CS> codingRationale() {

		return codingRationale;
	}

	@Override
	public DSET<? extends CD> translation() {

		return translation;
	}

	@Override
	public CD source() {

		return source;
	}

	@Override
	public BL implies(CD x) {
		// TODO Auto-generated method stub
		return null;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

}
